import Vue from 'vue'
import Router from 'vue-router'
//import Login from '../components/page/Login'

Vue.use(Router)

export default new Router({
    routes: [{
            path: '/',
            name: 'Login',
            component: resolve => require(['../views/login.vue'], resolve),
        },
        {
            path: '/system', //基础数据
            component: resolve => require(['../views/main.vue'], resolve),
            meta: {
                requireAuth: true,
            },
            children: [{
                    path: '/system/dictionary',
                    name: 'dictionary',
                    meta: { requireAuth: true, },
                    component: resolve => require(['../views/systems/data_dictionary/main_list.vue'], resolve)
                },
                {
                    path: '/system/messages',
                    name: 'user',
                    meta: { requireAuth: true, },
                    component: resolve => require(['../views/systems/data_messages/main_list.vue'], resolve)
                },
                // {
                //     path: '/system/films',
                //     name: 'films',
                //     meta: { requireAuth: true, },
                //     component: resolve => require(['../views/systems/films_management/main_list.vue'], resolve)
                // },
                {
                    path: '/system/backend',
                    name: 'backend',
                    meta: { requireAuth: true, },
                    component: resolve => require(['../views/systems/backend_management/main_list.vue'], resolve)
                },
            ]
        },
        {
            path: '/users', //用户管理
            component: resolve => require(['../views/main.vue'], resolve),
            meta: {
                requireAuth: true,
            },
            children: [{
                    path: '/users/user',
                    name: 'userList',
                    meta: { requireAuth: true, },
                    component: resolve => require(['../views/systems/user_management/main_list.vue'], resolve)
                },
                {
                    path: '/users/orders',
                    name: 'ordersList',
                    meta: { requireAuth: true, },
                    component: resolve => require(['../views/users/orders_management/main_list.vue'], resolve)
                },
                {
                    path: '/users/films',
                    name: 'filmsList',
                    meta: { requireAuth: true, },
                    component: resolve => require(['../views/users/films_management/main_list.vue'], resolve)
                },
                {
                    path: '/users/miniatures',
                    name: 'miniatures',
                    meta: { requireAuth: true, },
                    component: resolve => require(['../views/users/miniatures_management/main_list.vue'], resolve)
                },
                {
                    path: '/users/picasaTool',
                    name: 'picasaTool',
                    meta: { requireAuth: true, },
                    component: resolve => require(['../views/users/picasa_tool_management/main_list.vue'], resolve)
                },
                {
                    path: '/users/photoManage',
                    name: 'photoManage',
                    meta: { requireAuth: true, },
                    component: resolve => require(['../views/users/photo_management/main_list.vue'], resolve)
                },
            ]
        },
        {
            path: '/circle', //圈子管理
            component: resolve => require(['../views/main.vue'], resolve),
            meta: {
                requireAuth: true,
            },
            children: [{
                    path: '/circle/encyclopedia',
                    name: 'encyclopedia',
                    meta: { requireAuth: true, },
                    component: resolve => require(['../views/circle/circle_management/main_list.vue'], resolve)
                },
                {
                    path: '/circle/fransnana',
                    name: 'fransnana',
                    meta: { requireAuth: true, },
                    component: resolve => require(['../views/circle/circle_management/main_list.vue'], resolve)
                },
                {
                    path: '/circle/activity',
                    name: 'activity',
                    meta: { requireAuth: true, },
                    component: resolve => require(['../views/circle/circle_management/main_list.vue'], resolve)
                },
                {
                    path: '/circle/local',
                    name: 'local',
                    meta: { requireAuth: true, },
                    component: resolve => require(['../views/circle/local_management/main_list.vue'], resolve)
                },
            ]
        },
        {
            path: '/activity', //活动管理
            component: resolve => require(['../views/main.vue'], resolve),
            meta: {
                requireAuth: true,
            },
            children: [{
                    path: '/activity/prizes',
                    name: 'prizes',
                    meta: { requireAuth: true, },
                    component: resolve => require(['../views/activity/prizes_management/main_list.vue'], resolve)
                },
                {
                    path: '/circle/fransnana',
                    name: 'fransnana',
                    meta: { requireAuth: true, },
                    component: resolve => require(['../views/circle/circle_management/main_list.vue'], resolve)
                },
                {
                    path: '/circle/activity',
                    name: 'activity',
                    meta: { requireAuth: true, },
                    component: resolve => require(['../views/circle/circle_management/main_list.vue'], resolve)
                },
                {
                    path: '/activity/star',
                    name: 'star',
                    meta: { requireAuth: true, },
                    component: resolve => require(['../views/activity/star_management/main_list.vue'], resolve)
                },
            ]
        },
        {
            path: '/shops', //店铺管理
            component: resolve => require(['../views/main.vue'], resolve),
            meta: {
                requireAuth: true,
            },
            children: [{
                path: '/shops',
                name: 'shops',
                meta: { requireAuth: true, },
                component: resolve => require(['../views/shops/shops_management/main_list.vue'], resolve)
            }]
        },
        {
            path: '/commodity', //店铺管理
            component: resolve => require(['../views/main.vue'], resolve),
            meta: {
                requireAuth: true,
            },
            children: [{
                path: '/commodity',
                name: 'commodity',
                meta: { requireAuth: true, },
                component: resolve => require(['../views/commodity/commoditys_management/main_list.vue'], resolve)
            }]
        },
        {
            path: '*',
            name: '404',
            component: resolve => require(['../views/404.vue'], resolve),
        }
    ]
})